<%--
 * list.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="routes" requestURI="${requestURI}" id="row">


	<!-- Attributes -->

	<spring:message code="route.name" var="nameHeader" />
	<display:column property="name" title="${nameHeader}" sortable="true" />

	<spring:message code="route.difficulty" var="difficultyHeader" />
	<display:column property="difficulty" title="${difficultyHeader}" sortable="true" />
	
	<spring:message code="route.lenght" var="lenghtHeader" />
	<display:column property="lenght" title="${lenghtHeader}" sortable="true" />
	
	<jstl:if test="${elapsed}">
	<spring:message code="route.rating" var="ratingHeader" />
	<display:column property="rating" title="${ratingHeader}" sortable="true" />
	</jstl:if>
	
	<jstl:if test="${registered}">
		<display:column>
			<a href="evaluation/participant/create.do?routeId=${row.id}">
				<spring:message code="route.evaluate"/>
			</a>
		</display:column>
	</jstl:if>
	
</display:table>

<!-- Action links -->
<security:authorize access="hasRole('ADMIN')">
	<jstl:if test="${created}">
		<div>
			<a href="route/administrator/create.do?eventId=${eventId}"> <spring:message
					code="route.create" />
			</a>
		</div>
	</jstl:if>
</security:authorize>

